home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 275 < prev    next >
Text File  |  1996-08-06  |  893b  |  24 lines

  1. Newsgroups: comp.std.c
  2. Path: novice.uwaterloo.ca!lhuang
  3. From: lhuang@swen3.uwaterloo.ca (Larry Huang)
  4. Subject: Re: size_t
  5. Message-ID: <DM48Fv.5Ay@novice.uwaterloo.ca>
  6. Sender: lhuang@swen.uwaterloo.ca
  7. Date: Thu, 1 Feb 1996 21:16:43 GMT
  8. Nntp-Posting-Host: swen.uwaterloo.ca
  9. Organization: University of Waterloo
  10.  
  11. I was writing some code to manage a table the other day. I used
  12. a size_t to keep track of the size of the table, and I defined a
  13. macro SIZE_T_MAX as (size_t)(-1) for making sure the table doesn't
  14. get too large.  Then I suddenly realize that it may not work as
  15. I thought.  An implementation can restrict the size of a data
  16. object to 32 K (is my memory correct here?), but the value of
  17. (size_t)(-1) can at the same time be very large (e.g. ULONG_MAX).
  18. So my question is, is there a way to find out what the maximum
  19. allowable size of a data object  is under an implementation?
  20.  
  21. Larry
  22.  
  23.  
  24.